﻿<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    

    <title>所有文件</title>
    <link rel="shortcut icon" href="favicon.ico"> 
	<link href="css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="css/plugins/blueimp/css/blueimp-gallery.min.css" rel="stylesheet">

    <link href="css/animate.min.css" rel="stylesheet">
    <link href="js/plugins/layui/css/layui.css" rel="stylesheet">
    <link href="css/style.min.css?v=4.0.0" rel="stylesheet">

    <style>
        .lightBoxGallery img {
            margin: 5px;
            width: 160px;
        }
    </style>

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title"  style="height:72px;">
                        <div class="ibox-tools">
							
                            <a class="collapse-link" href="javascript:location.href=location.href;">
                                <i class="fa fa-refresh"></i>
                            </a>
                        </div>
                        <h5>基本 <small>分类/查找</small></h5>
						<div class="col-sm-12">
							<div class="col-sm-9">
								<form class="form-inline">
								<div class="input-group input-group-sm">
									<input id="username" type="text" class="form-control" placeholder="用户名"> 
								</div>
								<div class="input-group input-group-sm">
									<input id="startDate" type="text" class="form-control" placeholder="开始时间">
								</div>
								<div class="input-group input-group-sm">
									<input id="endDate" type="text" class="form-control" placeholder="结束时间"> 
								</div>
								<div class="input-group input-group-sm">
								 <button type="button" id="searchAllFiles" class="btn btn-sm btn-primary search" style="margin-bottom:2px;">搜索</button>
								</div>
								</form>
							</div>
							<div class="col-sm-3 text-right">
							</div>
						<div class="col-sm-6 text-right">
						</div>
						</div>
                    </div>
                    <div class="ibox-content">
                        <div class="lightBoxGallery">
							<div id="layTab">
							</div>
                            <div id="blueimp-gallery" class="blueimp-gallery">
                                <div class="slides"></div>
                                <h3 class="title"></h3>
                                <a class="prev">‹</a>
                                <a class="next">›</a>
                                <a class="close">×</a>
                                <a class="play-pause"></a>
                                <ol class="indicator"></ol>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.5"></script>
    <script src="js/content.min.js?v=1.0.0"></script>
    <script src="js/plugins/blueimp/jquery.blueimp-gallery.min.js"></script>
	<script src="js/plugins/toastr/toastr.min.js"></script>
	<script src="js/plugins/layui/layui.js"></script>
	<script src="js/custom/layTool.js"></script>
    <script type="text/javascript" src="js/custom/app.js" charset="UTF-8"></script>
    <script type="text/javascript" src="js/custom/tools.js" charset="UTF-8"></script>
	<script>
	var pageSize = 21;
	var pageNumber = 1;
	function searchAllFiles(pageNumber ,pageSize,username,startDate,endDate){
		var url = 'fileRun/getAllFilesByPage';
		jQuery.ajax({
			url:domain + url,
			type:"get",
			data:{"page":pageNumber,"pageSize":pageSize,"username":username,"startDate":startDate,"endDate":endDate},
			crossDomain:true,
			xhrFields:{
				withCredentials:true
			},
			success:function (data) {
				if(data.status == 200){
					var totalPage = data.data.total;//总页数
					pageNumber = data.data.page;//当前页
					var totalRow = data.data.records;//总条数
	   
					//拼凑html
					combHTML(data.data.rows);
					var arr = [username,startDate,endDate];
				   //分页
					LayPage('layTab',totalPage,totalRow,pageNumber ,pageSize,"searchAllFiles",arr);
				}else{
                    top.toastr.warning(data.msg);
                }
			},
			error:function(data) {
				top.toastr.error("查询列表失败，请检查网络");
			}
		})
		
	}
	
	function combHTML(data){
		var htmls = new Array();
		for (var i=0;i<data.length;i++){
			var url = domain + data[i].filePath;
			htmls.push('<a href="'+ url +'" title="'+ data[i].fileName +'" data-gallery=""><img src="'+ url +'"></a>');
							
		}
		$("#layTab").html(htmls.join(''));
	}
	
	$(function(){
		searchAllFiles(pageNumber ,pageSize,"","","");
		$("#searchAllFiles").on("click",function(){
			searchAllFiles(pageNumber,pageSize,$("#username").val(),$("#startDate").val(),$("#endDate").val());
		})
		
		layDate_start_end_dateTime('startDate','endDate');
	})
	</script>
	
	<script>	//=======   页面权限显示   ======//
	//当前菜单代码 (每个页面不一样，需要配置)
		var s_menuCode = "allFiles";
	//所有可用权限
		var roleAuth = app.permission(s_menuCode);
	//当前菜单所有可用权限（排除被禁用的按钮）
		var menuAuth = app.menuButtonByOn(s_menuCode);
		
		drawBtn(roleAuth,menuAuth);
	</script>
</body>

</html>
